package com.wave.wavesystem.serve.enums.post;

import com.wave.common.model.KV;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;

@AllArgsConstructor
@Getter
public enum PostStatusEnum {

    SAVE(0, "保存"),
    CHECK(1, "审核中"),
    PUBLISH(2, "发布"),
    REJECT(4, "拒绝通过"),
    BAN(3, "封禁");


    private final int code;
    private final String text;

    public static List<KV<Integer, String>> list() {
        return Arrays.stream(PostStatusEnum.values())
                .map(item -> new KV<>(item.getCode(), item.getText())).toList();
    }

}